package com.itheima.scan.beans;

import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.stereotype.Component;

@Component
@Configurable()
public class FlyableFactory {

    public Flyable create(String typeName) {
        return new FlyableImpl(typeName);
    }

    class FlyableImpl implements Flyable {
        private String typeName;

        private FlyableImpl(String typeName) {
            this.typeName = typeName;
        }

        @Override
        public void fly() {
            System.out.println(typeName + "飞了");
        }

    }
}
